from business_processes.opening_account_validation.application.use_case.command import (
    AccountPackageCommandUseCase,
)
from business_processes.opening_account_validation.application.use_case.query import (
    PackageQueryUseCase
)
from business_processes.opening_account_validation.domain.service.check_package import (
    OpeningAccountCheckService
)
from business_processes.opening_account_validation.infra.repository import (
    PackageRepository
)
from core.infra.database.connection import get_db_session
from dependency_injector import containers, providers


class OpeningAccountContainer(containers.DeclarativeContainer):
    account_package_repo = providers.Factory(PackageRepository)

    account_package_service = providers.Factory(OpeningAccountCheckService)

    reservation_query = providers.Factory(
        PackageQueryUseCase,
        account_package_repo=account_package_repo,
        db_session=get_db_session,
    )
    reservation_command = providers.Factory(
        AccountPackageCommandUseCase,
        account_package_repo=account_package_repo,
        account_package_service=account_package_service,
        db_session=get_db_session,
    )
